using Mono.Cecil.Cil;

namespace Cil.Ast;

public sealed class RethrowExpression : SingleInstructionExpression
{
	public const int MaxNodes = 0;

	public RethrowExpression(Context context, Instruction position)
		: base(context, position)
	{
		// base class
		ReturnType = Context.MakeRef(typeof(void));
		WritesStack = 0;
		ReadsStack = 0;
		Nodes = new FixedList<Expression>();
	}

	public override string ToString()
	{
		return string.Format("throw{0}", FinalString);
	}
}

public static partial class IlAst
{
	public static RethrowExpression Rethrow(Context context, Instruction position)
	{
		return new RethrowExpression(context, position);
	}
}